package com.hmall.api.client;

import com.config.DefaultFeign;
import com.fallback.CartClientFallback;
import com.fallback.ItemClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Collection;
import java.util.List;
import java.util.Set;
@FeignClient(value = "cart-service",fallbackFactory = CartClientFallback.class,configuration = DefaultFeign.class)//告诉SpringCloud这个接口是一个Feign客户端，要调用cart-service服务
//给予负载均衡选择一个服务实例
public interface CartClient {
    //在接口内编写要远程调用的方法,这些方法都可以参考cart-service服务提供的接口
    @DeleteMapping("/carts")
    public void deleteCartItemByIds(@RequestParam("ids") Collection<Long> ids);
}

